// 挂载变量
import {
	BASE_URL,
	API_URL,
	IMG_URL
} from '../env.js';

import store from '@/trnall/store';
import http from '@/trnall/request';
import platform from '@/trnall/platform';
// import tools from '@/trnall/utils/tools'
// mixin混入
import mixin from '@/trnall/mixins';
// #ifdef H5
// uni方法重写, h5的粘贴板的设置，获取。图片视频的保存
/* import wxsdk from '@/trnall/wechat/sdk'
import VConsole from 'vconsole'
import '@/trnall/utils/sdk-h5.js' */
// #endif

import wechat from '@/trnall/wechat/wechat';
const install = Vue => {
	// // 挂载请求
	Vue.prototype.$http = http;
	// // 平台判断
	Vue.prototype.$platform = platform;
	// // 挂载工具函数
	// Vue.prototype.$tools = tools;
	Vue.prototype.$BASE_URL = BASE_URL;
	Vue.prototype.$API_URL = API_URL;
	Vue.prototype.$IMG_URL = IMG_URL;
	Vue.mixin(mixin);
}

export async function init(options) {
	console.log('init')
	await store.dispatch("appInit");
}

export default {
	install
}
